----------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\KDIS\Dropbox\projects\mentoring_bhutan\_journal submission\JPAM - accepted\replication_package\code\../output/log_files/bhutan_mentoring_analysi
> s_16Jul2025.log
  log type:  text
 opened on:  16 Jul 2025, 12:58:09

. 
. cap program drop add_symbol 

. program add_symbol
  1.         scalar p = 2*ttail(e(df_r), abs(`=scalar(t)'))
  2.         if `=scalar(p)' > 0.1 {
  3.                 scalar symbol = ""
  4.         }
  5.         if `=scalar(p)' < 0.1 & `=scalar(p)'>=0.05 {
  6.                 scalar symbol = "*"
  7.         }
  8.         if `=scalar(p)' < 0.05 & `=scalar(p)'>=0.01 {
  9.                 scalar symbol = "**"
 10.         }
 11.         if `=scalar(p)' < 0.01 {
 12.                 scalar symbol = "***"
 13.         }
 14. end

. 
. 
. *****************************************************************************
. *****************************************************************************
. ******************** IN-TEXT NUMBERS ****************************************
. *****************************************************************************
. *****************************************************************************
. 
. *** Mentor Characteristics 
. ****************************
. use "$clean/STEM_mentor.dta", clear

. gen grade = 10 

. append using "$clean/TVET_mentor.dta"
(variable mentor_male was byte, now float to accommodate using data's values)
(variable mentor_email was str32, now str37 to accommodate using data's values)
(label recommendation already defined)
(label experience already defined)
(label sat already defined)

. replace grade = 12 if missing(grade)
(140 real changes made)

. 
. lab def grade 10 "Grade 10" 12 "Grade 12", modify

. lab val grade grade

. 
. * Previous experience with being a mentee
. bys grade: tab mentor_beenmentee

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 10

   Have you |
 ever had a |
  mentor of |
  your own? |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        100       51.55       51.55
          1 |         94       48.45      100.00
------------+-----------------------------------
      Total |        194      100.00

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 12

   Have you |
 ever had a |
  mentor of |
  your own? |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         49       47.57       47.57
          1 |         54       52.43      100.00
------------+-----------------------------------
      Total |        103      100.00


. bys grade: tab mentor_beenmentee_sat

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 10

 If you have been |
   a mentee, were |
    you satisfied |
        with your |
       mentorship |
      experience? |      Freq.     Percent        Cum.
------------------+-----------------------------------
          slighly |          9        9.57        9.57
       moderately |         29       30.85       40.43
             very |         37       39.36       79.79
        extremely |         19       20.21      100.00
------------------+-----------------------------------
            Total |         94      100.00

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 12

 If you have been |
   a mentee, were |
    you satisfied |
        with your |
       mentorship |
      experience? |      Freq.     Percent        Cum.
------------------+-----------------------------------
       not at all |          1        1.85        1.85
          slighly |          4        7.41        9.26
       moderately |         19       35.19       44.44
             very |         24       44.44       88.89
        extremely |          5        9.26       98.15
decline to answer |          1        1.85      100.00
------------------+-----------------------------------
            Total |         54      100.00


. 
. * Experience with mentoring 
. bys grade: tab mentor_exp

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 10

Approximatel |
  y how many |
     persons |
(mentees) to |
   whom have |
you provided |
   help with |
         Mat |      Freq.     Percent        Cum.
-------------+-----------------------------------
        none |          8        4.12        4.12
 1-2 persons |         33       17.01       21.13
 3-5 persons |         41       21.13       42.27
6-10 persons |         31       15.98       58.25
more than 10 |         77       39.69       97.94
  don't know |          4        2.06      100.00
-------------+-----------------------------------
       Total |        194      100.00

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 12

Approximatel |
  y how many |
     persons |
(mentees) to |
   whom have |
you provided |
   help with |
         Mat |      Freq.     Percent        Cum.
-------------+-----------------------------------
        none |         19       18.45       18.45
 1-2 persons |         26       25.24       43.69
 3-5 persons |         26       25.24       68.93
6-10 persons |          8        7.77       76.70
more than 10 |         17       16.50       93.20
  don't know |          7        6.80      100.00
-------------+-----------------------------------
       Total |        103      100.00


. tab mentor_expstem

Approximatel |
  y how many |
     persons |
   (mentees) |
   with whom |
    have you |
shared about |
     STEMM u |      Freq.     Percent        Cum.
-------------+-----------------------------------
        none |         20       10.31       10.31
 1-2 persons |         46       23.71       34.02
 3-5 persons |         43       22.16       56.19
6-10 persons |         36       18.56       74.74
more than 10 |         43       22.16       96.91
  don't know |          6        3.09      100.00
-------------+-----------------------------------
       Total |        194      100.00

. 
. * Satisfaction with current study
. bys grade: tab mentor_progrec

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 10

   How much do you |
    recommend your |
  program for your |
        friends or |
         siblings? |      Freq.     Percent        Cum.
-------------------+-----------------------------------
      strongly not |          2        1.03        1.03
           neutral |         33       17.01       18.04
         recommend |         78       40.21       58.25
strongly recommend |         81       41.75      100.00
-------------------+-----------------------------------
             Total |        194      100.00

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> grade = Grade 12

   How much do you |
    recommend your |
  program for your |
        friends or |
         siblings? |      Freq.     Percent        Cum.
-------------------+-----------------------------------
           neutral |         10        9.71        9.71
         recommend |         22       21.36       31.07
strongly recommend |         71       68.93      100.00
-------------------+-----------------------------------
             Total |        103      100.00


. 
. * Others 
. lab var mentor_years "Year in college"

. estpost tabstat mentor_age mentor_male mentor_years b5extro b5agree b5consci b5neuro b5open if grade==10, c(stat) stat(mean sd min max n) 

Summary statistics: mean sd min max count
     for variables: mentor_age mentor_male mentor_years b5extro b5agree b5consci b5neuro b5open

             |   e(mean)      e(sd)     e(min)     e(max)   e(count) 
-------------+-------------------------------------------------------
  mentor_age |     22.11   2.241208         18         36        200 
 mentor_male |      .585   .4939585          0          1        200 
mentor_years |  2.781915   .8275294          1          5        188 
     b5extro |  3.329016   .6571445         .5          5        193 
     b5agree |  3.792746    .500803   2.666667          5        193 
    b5consci |  3.830743   .5369659   2.333333   4.666667        193 
     b5neuro |  2.290155   .6743317   .6666667   4.333333        193 
      b5open |  4.199482    .505828   2.666667          5        193 

. esttab using "$tabfig/mentor10.tex", replace ////
>  cells("mean(fmt(%6.2fc)) sd(fmt(%6.2fc)) min max count") nonumber ///
>   nomtitle nonote noobs label booktabs ///
>   collabels("Mean" "SD" "Min" "Max" "N")
(file ../output/tables_figures/mentor10.tex not found)
(output written to ../output/tables_figures/mentor10.tex)

. 
. estpost tabstat mentor_age mentor_male b5extro b5agree b5consci b5neuro b5open if grade==12, c(stat) stat(mean sd min max n) 

Summary statistics: mean sd min max count
     for variables: mentor_age mentor_male b5extro b5agree b5consci b5neuro b5open

             |   e(mean)      e(sd)     e(min)     e(max)   e(count) 
-------------+-------------------------------------------------------
  mentor_age |  22.71739   2.428508         18         30        138 
 mentor_male |  .7357143   .4425354          0          1        140 
     b5extro |  2.980583   .5318305          1   4.333333        103 
     b5agree |  3.702265   .5618841   2.666667   4.666667        103 
    b5consci |  3.708738   .5335776   2.333333   4.666667        103 
     b5neuro |  2.449838   .6678237   .6666667   3.666667        103 
      b5open |   4.02589   .5536359          3          5        103 

. esttab using "$tabfig/mentor12.tex", replace ////
>  cells("mean(fmt(%6.2fc)) sd(fmt(%6.2fc)) min max count") nonumber ///
>   nomtitle nonote noobs label booktabs ///
>   collabels("Mean" "SD" "Min" "Max" "N")
(file ../output/tables_figures/mentor12.tex not found)
(output written to ../output/tables_figures/mentor12.tex)

. 
. 
. *** Mentor-Mentee Meetings
. ****************************
. * General information
. use "$clean/grade10_analysis.dta", clear

. gen grade = 10 

. append using "$clean/grade12_analysis.dta"
(label rateexper already defined)
(label male already defined)

. replace grade = 12 if missing(grade)
(5,540 real changes made)

. 
. * Summary of the mentor-mentee meetings that were online
. su num_online if grade == 10

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  num_online |        957    .5501567    .3488304          0          1

. su num_online if grade == 12

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  num_online |        472    .3684675     .302519          0          1

. 
. * Summary of the communication beyond official meetings
. su communication if grade == 10

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
communicat~n |        957    .4196273     .408611          0          1

. su communication if grade == 12

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
communicat~n |        472    .5038842    .4035803          0          1

. 
. su communication_m if grade == 10

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
communicat~m |        957    .5935214    .4914327          0          1

. su communication_m if grade == 12

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
communicat~m |        472    .7076271    .4553353          0          1

. 
. * Distribution of the middle 80% length of each meeting
. foreach grade in 10 12 { 
  2.         forval i=1/4 {
  3.         graph box meeting_minutes`i' if grade==`grade', noout name(m`i', replace) subtitle("meeting `i'")
  4.         }
  5.         gr combine m1 m2 m3 m4, c(4) ycommon
  6.         gr export "$tabfig/meeting_length`grade'.png", as(png) replace
  7. }
(file ../output/tables_figures/meeting_length10.png not found)
file ../output/tables_figures/meeting_length10.png saved as PNG format
(file ../output/tables_figures/meeting_length12.png not found)
file ../output/tables_figures/meeting_length12.png saved as PNG format

. 
. * Distribution of discussion topics 
. use "$clean/mentor_report_discussion.dta", clear 

. lab def grade 10 "Grade 10" 12 "Grade 12", modify

. lab val grade grade

. 
. graph bar share, over(topic) over(thenumberofthemeeting, gap(0)) over(grade) stack asyvars ///
>     legend(order(1 "Importance of STEM/TVET" 2 "Student Life Experience" 3 "Courses and Study Options" 4 "Career Path" 5 "Labor Market Information" 6 "Entry Require
> ment" 7 "Application Process" 8 "General Perception of TVET/STEM" 9 "Others") size(small)) ///
>     ytitle("Share (%)") 

. gr export "$tabfig/discussion_topics.png", as(png) replace
(file ../output/tables_figures/discussion_topics.png not found)
file ../output/tables_figures/discussion_topics.png saved as PNG format

. 
.         
.         
. *****************************************************************************
. *****************************************************************************
. ********* REPRESENTATIVENESS OF THE STUDY SAMPLE CHARACTERISTICS ************
. *****************************************************************************
. *****************************************************************************
. 
. use  "$clean/comparison_grade910_baseline_reachable_wgrade.dta", clear

. gen sample10 = 1

. append using "$clean/comparison_all_grade910_baseline.dta"

. replace sample10 = 0 if missing(sample10)
(21,825 real changes made)

. gen grade = 10

. 
. append using "$clean/comparison_grade1112_baseline_reachable_wgrade.dta" 

. gen sample12 = 1 if missing(sample10)
(34,728 missing values generated)

. append using "$clean/comparison_all_grade1112_baseline.dta"

. replace sample12 = 0 if missing(sample12) & missing(sample10)
(21,529 real changes made)

. replace grade = 12 if missing(grade)
(32,177 real changes made)

. 
. gl grade10_comparison "age_bl male father_edu mother_edu perf_math_bl perf_scie_bl big5extro_bl big5agree_bl big5consci_bl big5neuro_bl big5open_bl i_sci_top1_bl i_
> e6_bl like_math_bl like_scie_bl attitude_stem_bl genderbias_bl subj_sci_bl e9c_bl approval_sci_bl e16c_bl ability_bl"

. 
. gl grade12_comparison "age_bl male father_edu mother_edu perf_eng_bl perf_lang_bl big5extro_bl big5agree_bl big5consci_bl big5neuro_bl big5open_bl i_f9g_bl i_f14g_b
> l bluecollarbias_bl attitude_stem_bl genderbias_tvet_bl  subj_tvet_bl satisfied_tvet_bl approval_tvet_bl f16g_bl ability_tvet_bl i_g4b_bl i_g5b_bl "

. 
. cap erase "$tabfig/comparison_sample10.tex"

. cap erase "$tabfig/comparison_sample12.tex"

. 
. foreach grade in 10 12 {
  2.         
.         foreach i in comparison {
  3.         foreach x of global grade`grade'_`i' {
  4.                 
.                 qui sum `x' if grade == `grade'                         
  5.                 * obtain labels
.                 local Label`x': variable label `x'
  6.         
.                 * obtain # observations
.                 qui sum `x' if sample`grade' == 0 & grade == `grade'
  7.                 local N: dis %3.0f r(N)
  8.                 local Ns = "`N'"
  9.         
.                 * obtain mean of the whole sample 
.                 qui sum `x' if sample`grade' == 0 & grade==`grade'
 10.                 local meanC: dis %3.2f r(mean)
 11.                 local meanCs = "`meanC'"
 12.                 
.                 * obtain mean of the study sample 
.                 qui sum `x' if sample`grade' == 1 & grade==`grade'
 13.                 local meanT: dis %3.2f r(mean)
 14.                 local meanTs = "`meanT'"
 15.         
.                 * obtain p-value of the difference between the study sample and the whole sample
.                 qui reg `x' sample`grade' if grade==`grade', r
 16.                 
.                 scalar t = _b[sample`grade']/_se[sample`grade']
 17.                 local p = 2*ttail(e(df_r), abs(`=scalar(t)'))
 18.                 local pvalue: dis %4.3f `p'
 19.                 local pvalues: dis "`pvalue'"
 20.                 
.                 if inlist("`x'", "age_bl") {
 21.                         mata R = ("", "", "", "" \ "`N'", "`meanCs'", "`meanTs'", "`pvalues'")
 22.                         mmat2tex R using "$tabfig/comparison_sample`grade'.tex", append rownames("\emph{Panel A: Demographics}" "`Label`x''")
 23.                 } 
 24.                 else if inlist("`x'", "i_sci_top1_bl", "i_f9g_bl") {
 25.                         mata R = ("", "", "", "" \ "", "", "", "" \ "`N'", "`meanCs'", "`meanTs'", "`pvalues'")
 26.                         mmat2tex R using "$tabfig/comparison_sample`grade'.tex", append rownames("" "\emph{Panel B: Primary Outcomes}" "`Label`x''")
 27.                 } 
 28.                 else if inlist("`x'", "i_e6_bl", "bluecollarbias_bl") {
 29.                         mata R = ("", "", "", "" \ "", "", "", "" \ "`N'", "`meanCs'", "`meanTs'", "`pvalues'")
 30.                         mmat2tex R using "$tabfig/comparison_sample`grade'.tex", append rownames("" "\emph{Panel C: Intermediate Outcomes}" "`Label`x''")
 31.                 } 
 32.                 else {
 33.                         mata R = ("`N'", "`meanCs'", "`meanTs'", "`pvalues'")
 34.                         mmat2tex R using "$tabfig/comparison_sample`grade'.tex", append rownames("`Label`x''")
 35.                 }
 36.                 }
 37.         }
 38. }
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample10.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex
Latex file written to ../output/tables_figures/comparison_sample12.tex

.         
.         
. 
. *****************************************************************************
. *****************************************************************************
. ************************ BASELINE CHARACTERISTICS ***************************
. *****************************************************************************
. *****************************************************************************
. use "$clean/grade10_analysis.dta", clear

. gen grade = 10 

. append using "$clean/grade12_analysis.dta"
(label rateexper already defined)
(label male already defined)

. replace grade = 12 if missing(grade)
(5,540 real changes made)

. 
. gl grade10 "age_bl male father_edu mother_edu i_sci_top1_bl i_e6_bl approval_sci_bl attitude_stem_bl genderbias_bl mt_parents mt_friends mt_teachers" 

. estpost tabstat $grade10 if grade == 10, c(stat) stat(mean sd n) 

Summary statistics: mean sd count
     for variables: age_bl male father_edu mother_edu i_sci_top1_bl i_e6_bl approval_sci_bl attitude_stem_bl genderbias_bl mt_parents mt_friends mt_teachers

             |   e(mean)      e(sd)   e(count) 
-------------+---------------------------------
      age_bl |  16.75875   1.322547       6458 
        male |  .4487457   .4974046       6458 
  father_edu |  .2024498   .4018599       5878 
  mother_edu |  .1239967   .3296048       6105 
i_sci_top1~l |    .36869    .482487       6458 
     i_e6_bl |  .7426448   .4372106       6458 
approval_s~l |  3.911625   .8286438       6397 
attitude_s~l |  3.979975   .8534446       6442 
genderb~s_bl |  2.219989   .8123871       6451 
  mt_parents |  .5721586   .4948041       6458 
  mt_friends |  .4992258   .5000381       6458 
 mt_teachers |  .1492722   .3563842       6458 

. esttab using "$tabfig/sample10.tex", replace ////
>  cells("mean(fmt(%6.2fc)) sd(fmt(%6.2fc)) count(fmt(%6.0fc))") nonumber ///
>   nomtitle nonote noobs label booktabs ///
>   collabels("Mean" "SD" "N") f 
(file ../output/tables_figures/sample10.tex not found)
(output written to ../output/tables_figures/sample10.tex)

. 
. gl grade12 "age_bl male father_edu mother_edu i_1f9g_bl i_f9g_bl i_1f14g_bl i_f14g_bl approval_tvet_bl attitude_stem_bl genderbias_tvet_bl bluecollarbias_bl mt_pare
> nts mt_friends mt_teachers"

. estpost tabstat $grade12 if grade == 12, c(stat) stat(mean sd n) 

Summary statistics: mean sd count
     for variables: age_bl male father_edu mother_edu i_1f9g_bl i_f9g_bl i_1f14g_bl i_f14g_bl approval_tvet_bl attitude_stem_bl genderbias_tvet_bl bluecollarbias_bl m
> t_parents mt_friends mt_teachers

             |   e(mean)      e(sd)   e(count) 
-------------+---------------------------------
      age_bl |  18.87762   1.432795       5540 
        male |  .4341155    .495685       5540 
  father_edu |  .2076323   .4056537       4874 
  mother_edu |  .0468609   .2113599       5527 
   i_1f9g_bl |  .0305054   .1719889       5540 
    i_f9g_bl |  .2090253   .4066492       5540 
  i_1f14g_bl |  .0270758    .162319       5540 
   i_f14g_bl |  .1806859   .3847925       5540 
approval_t~l |  50.27613    20.9847       4708 
attitude_s~l |  4.111514   .8660169       5515 
genderb~t_bl |  2.299554   1.121918       5161 
bluecollar~l |  3.278773    .796882       5303 
  mt_parents |  .6245487   .4842829       5540 
  mt_friends |  .4189531   .4934322       5540 
 mt_teachers |  .1133574   .3170578       5540 

. esttab using "$tabfig/sample12.tex", replace ////
>  cells("mean(fmt(%6.2fc)) sd(fmt(%6.2fc)) count(fmt(%6.0fc))") nonumber ///
>   nomtitle nonote noobs label booktabs ///
>   collabels("Mean" "SD" "N") f
(file ../output/tables_figures/sample12.tex not found)
(output written to ../output/tables_figures/sample12.tex)

. 
. 
. * Figure on errors in beliefs about employment rates
. gr box error_g1b_bl, over(male) ytitle("errors in beliefs about employment rate (pp)") name(m1, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr box error_g2b_bl, over(male) ytitle("errors in beliefs about earnings (log points)") name(m2, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr combine m1 m2, c(2) scale(1.3) subtitle("TVET Degree", size(small)) 
(note:  named style s not found in class linepattern, default attributes used)
(note:  named style s not found in class linepattern, default attributes used)

. gr export "$tabfig/belief_tvet.png", as(png) replace 
(file ../output/tables_figures/belief_tvet.png not found)
file ../output/tables_figures/belief_tvet.png saved as PNG format

. 
. gr box error_g1a_bl, over(male) ytitle("errors in beliefs about employment rate (pp)") name(m1, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr box error_g2a_bl, over(male) ytitle("errors in beliefs about earnings (log points)") name(m2, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr combine m1 m2, c(2) scale(1.3) subtitle("University Degrees", size(small))
(note:  named style s not found in class linepattern, default attributes used)
(note:  named style s not found in class linepattern, default attributes used)

. gr export "$tabfig/belief_uni.png", as(png) replace 
(file ../output/tables_figures/belief_uni.png not found)
file ../output/tables_figures/belief_uni.png saved as PNG format

. 
. gr box error_g1c_bl, over(male) ytitle("errors in beliefs about employment rate (pp)") name(m1, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr box error_g2c_bl, over(male) ytitle("errors in beliefs about earnings (log points)") name(m2, replace) yline(0, lc(red) lp(s))
(note:  named style s not found in class linepattern, default attributes used)

. gr combine m1 m2, c(2) scale(1.3) subtitle("High School Diploma", size(small))
(note:  named style s not found in class linepattern, default attributes used)
(note:  named style s not found in class linepattern, default attributes used)

. gr export "$tabfig/belief_HS.png", as(png) replace 
(file ../output/tables_figures/belief_HS.png not found)
file ../output/tables_figures/belief_HS.png saved as PNG format

. 
. 
. 
. *****************************************************************************
. *****************************************************************************
. *************************** BALANCE TEST ************************************
. *****************************************************************************
. *****************************************************************************
. 
. use "$clean/grade10_analysis.dta", clear

. gen grade = 10 

. append using "$clean/grade12_analysis.dta"
(label rateexper already defined)
(label male already defined)

. replace grade = 12 if missing(grade)
(5,540 real changes made)

. 
. gl grade10_primary "i_sci_top1_bl"

. gl grade10_secondary "i_e6_bl z_like_math_bl z_like_scie_bl z_like_all_bl z_attitude_stem_bl z_genderbias_bl z_subj_sci_bl z_e9c_bl z_approval_sci_bl z_e16c_bl z_ab
> ility_bl"

. gl grade10_covariates "age_bl male father_edu mother_edu z_wealth_bl z_perf_math_bl z_perf_scie_bl z_perf_oths_bl z_perf_all_bl potentialshare z_big5extro_bl z_big5
> agree_bl z_big5consci_bl z_big5neuro_bl z_big5open_bl"

. 
. gl grade12_primary "i_f9g_bl i_f14g_bl" 

. gl grade12_secondary "z_bluecollarbias_bl z_attitude_stem_bl z_genderbias_tvet_bl z_subj_tvet_bl z_satisfied_tvet_bl z_approval_tvet_bl z_f16g_bl z_ability_tvet_bl 
> i_g4b_bl i_g5b_bl"

. gl grade12_covariates "age_bl male father_edu mother_edu z_wealth_bl z_perf_eng_bl z_perf_lang_bl z_perf_all_bl potentialshare z_big5extro_bl z_big5agree_bl z_big5c
> onsci_bl z_big5neuro_bl z_big5open_bl"

. 
. 
. ******* Balance checks of missing values of all variables at baseline
. ****************************************************************************
. cap erase "$tabfig/balance_missing10.tex"

. cap erase "$tabfig/balance_missing12.tex"

. 
. cap drop m10_* m12_*

. 
. foreach grade in 10 12 {
  2.         foreach i in primary secondary covariates {
  3.                 foreach x of global grade`grade'_`i' {  
  4.                         cap gen m`grade'_`x' = missing(`x') 
  5.                         replace m`grade'_`x' = . if grade~=`grade'      
  6.                 }
  7.         }
  8.         
.         foreach i in primary secondary covariates {
  9.         foreach x of global grade`grade'_`i' {
 10.                 
.                 qui sum m`grade'_`x' if grade == `grade'
 11.                 if r(mean) ~= 0 {                                       
 12.                 * obtain labels
.                 local Label`x': variable label `x'
 13.         
.                 * obtain # observations
.                 qui sum m`grade'_`x' if grade == `grade'
 14.                 local N: dis %3.0f r(N)
 15.                 local Ns = "`N'"
 16.         
.                 * obtain mean Control 
.                 qui sum m`grade'_`x' if CONTROL == 1 & grade==`grade'
 17.                 local meanC: dis %3.2f r(mean)
 18.                 local meanCs = "`meanC'"
 19.                 
.                 * obtain difference between Treatment/Spillover and Control 
.                 qui areg m`grade'_`x' TREAT SPILL if grade==`grade', a(strata) cl(school)
 20.                 foreach group in TREAT SPILL {
 21.                         local diff`group': dis %4.2f _b[`group']
 22.                         local diff`group's: dis "`diff`group''"
 23.                         
.                         scalar t = _b[`group']/_se[`group']
 24.                         local p`group' = 2*ttail(e(df_r), abs(`=scalar(t)'))
 25.                         local pvalue`group': dis %4.2f `p`group''
 26.                         local pvalue`group's: dis "`pvalue`group''"
 27.                 }
 28.                 
.                 * obtain the difference between treatment and spillover 
.                 qui areg m`grade'_`x' TREAT if CONTROL!=1 & grade==`grade', a(school)
 29.                         local dTREAT: dis %4.2f _b[TREAT]
 30.                         local dTREATs: dis "`dTREAT'"
 31.                         scalar t = _b[TREAT]/_se[TREAT]
 32.                         local p = 2*ttail(e(df_r), abs(`=scalar(t)'))
 33.                         local pvalue: dis %4.2f `p'
 34.                         local pvalues: dis "`pvalue'"
 35. 
.                 * export results 
.                 mata R = ("`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'", "`dTREATs'", "`pvalues'" )
 36.                 mmat2tex R using "$tabfig/balance_missing`grade'.tex", append rownames("`Label`x''")
 37.                 }
 38.                 }
 39.         }
 40. }
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
(5,540 real changes made, 5,540 to missing)
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
Latex file written to ../output/tables_figures/balance_missing10.tex
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
(6,458 real changes made, 6,458 to missing)
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex
Latex file written to ../output/tables_figures/balance_missing12.tex

. 
. 
. 
. 
. ************** Balance checks of values of all variables at baseline
. ****************************************************************************
. cap erase "$tabfig/balance_grade10.tex"

. cap erase "$tabfig/balance_grade12.tex"

. 
. cap drop m10_* m12_*

. 
. foreach grade in 10 12 {        
  2.         foreach i in covariates primary secondary {
  3.         foreach x of global grade`grade'_`i' {
  4.                 
.                 qui sum `x' if grade == `grade'
  5.                 if r(mean) ~= 0 {                                       
  6.                 * obtain labels
.                 local Label`x': variable label `x'
  7.         
.                 * obtain # observations
.                 qui sum `x' if grade == `grade'
  8.                 local N: dis %3.0f r(N)
  9.                 local Ns = "`N'"
 10.         
.                 * obtain mean Control 
.                 qui sum `x' if CONTROL == 1 & grade==`grade'
 11.                 local meanC: dis %3.2f r(mean)
 12.                 local meanCs = "`meanC'"
 13.                 
.                 * obtain difference between Treatment/Spillover and Control 
.                 qui areg `x' TREAT SPILL if grade==`grade', a(strata) cl(school)
 14.                 foreach group in TREAT SPILL {
 15.                         local diff`group': dis %4.2f _b[`group']
 16.                         local diff`group's: dis "`diff`group''"
 17.                         
.                         scalar t = _b[`group']/_se[`group']
 18.                         local p`group' = 2*ttail(e(df_r), abs(`=scalar(t)'))
 19.                         local pvalue`group': dis %4.2f `p`group''
 20.                         local pvalue`group's: dis "`pvalue`group''"
 21.                 }
 22.                 
.                 * obtain the difference between treatment and spillover 
.                 qui areg `x' TREAT if CONTROL!=1 & grade==`grade', a(school)
 23.                         local dTREAT: dis %4.2f _b[TREAT]
 24.                         local dTREATs: dis "`dTREAT'"
 25.                         scalar t = _b[TREAT]/_se[TREAT]
 26.                         local p = 2*ttail(e(df_r), abs(`=scalar(t)'))
 27.                         local pvalue: dis %4.2f `p'
 28.                         local pvalues: dis "`pvalue'"
 29. 
.                 * export results
.                 if inlist("`x'", "age_bl") {
 30.                         mata R = ("", "", "", "", "", "", "", "" \ "`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'", "`dTR
> EATs'", "`pvalues'")
 31.                         mmat2tex R using "$tabfig/balance_grade`grade'.tex", append rownames("\emph{Panel A: Demographics}" "`Label`x''")
 32.                 } 
 33.                 else if inlist("`x'", "i_sci_top1_bl", "i_f9g_bl") {
 34.                         mata R = ("", "", "", "", "", "", "", "" \ "", "", "", "", "", "", "", "" \ "`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffS
> PILLs'" , "`pvalueSPILLs'", "`dTREATs'", "`pvalues'")
 35.                         mmat2tex R using "$tabfig/balance_grade`grade'.tex", append rownames("" "\emph{Panel B: Primary Outcomes}" "`Label`x''")
 36.                 } 
 37.                 else if inlist("`x'", "i_e6_bl", "z_bluecollarbias_bl") {
 38.                         mata R = ("", "", "", "", "", "", "", "" \ "", "", "", "", "", "", "", "" \ "`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffS
> PILLs'" , "`pvalueSPILLs'", "`dTREATs'", "`pvalues'")
 39.                         mmat2tex R using "$tabfig/balance_grade`grade'.tex", append rownames("" "\emph{Panel C: Intermediate Outcomes}" "`Label`x''")
 40.                 } 
 41.                 else {
 42.                         mata R = ("`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'", "`dTREATs'", "`pvalues'")
 43.                         mmat2tex R using "$tabfig/balance_grade`grade'.tex", append rownames("`Label`x''")
 44.                 }
 45.                 }
 46.                 }
 47.         }
 48. }
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade10.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex
Latex file written to ../output/tables_figures/balance_grade12.tex

. 
. 
. 
. 
. *****************************************************************************
. *****************************************************************************
. ********************** ATTRITION ANALYSIS ***********************************
. *****************************************************************************
. *****************************************************************************
. 
. use "$clean/grade10_analysis.dta", clear

. gen grade = 10 

. append using "$clean/grade12_analysis.dta"
(label rateexper already defined)
(label male already defined)

. replace grade = 12 if missing(grade)
(5,540 real changes made)

. 
. est clear

. // Probability of attrition by treatment and control individuals
. foreach grade in 10 12 {
  2.         local outcomelist "attrition1 attrition_test"
  3.         if `grade' == 12 {
  4.                 local outcomelist "attrition1 attrition2 attrition_test"
  5.         }
  6.     
.         foreach outcome of local outcomelist {
  7.         qui sum `outcome' if CONTROL == 1 & grade == `grade', de
  8.                 qui local cmean_c: di %9.3f r(mean)
  9.         
.         eststo ta1`grade'n`outcome': areg `outcome' TREAT SPILL if grade == `grade', a(strata) cl(school)
 10.         local r2a: di %5.3f e(r2)
 11.         estadd local rsq "`r2a'"
 12.         estadd local mean_outcome = "`cmean_c'"
 13.                 
.         eststo dta1`grade'n`outcome': lincomest TREAT - SPILL
 14.         }
 15. }               

Linear regression, absorbing indicators             Number of obs     =  6,458
Absorbed variable: strata                           No. of categories =     13
                                                    F(2, 75)          =   1.54
                                                    Prob > F          = 0.2200
                                                    R-squared         = 0.0094
                                                    Adj R-squared     = 0.0072
                                                    Root MSE          = 0.1991

                                (Std. err. adjusted for 76 clusters in school)
------------------------------------------------------------------------------
             |               Robust
  attrition1 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       TREAT |   .0113395    .007963     1.42   0.159    -.0045236    .0272026
       SPILL |   .0203064   .0119043     1.71   0.092    -.0034083     .044021
       _cons |   .0322162   .0043381     7.43   0.000     .0235743    .0408581
------------------------------------------------------------------------------

added macro:
                e(rsq) : "0.009"

added macro:
       e(mean_outcome) : "0.032"
Confidence interval for formula:
TREAT-SPILL

------------------------------------------------------------------------------
  attrition1 | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0089669   .0091052    -0.98   0.328    -.0271053    .0091715
------------------------------------------------------------------------------

Linear regression, absorbing indicators             Number of obs     =  6,458
Absorbed variable: strata                           No. of categories =     13
                                                    F(2, 75)          =   1.48
                                                    Prob > F          = 0.2343
                                                    R-squared         = 0.0052
                                                    Adj R-squared     = 0.0030
                                                    Root MSE          = 0.1612

                                (Std. err. adjusted for 76 clusters in school)
------------------------------------------------------------------------------
             |               Robust
attrition_~t | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       TREAT |   .0086859    .006466     1.34   0.183     -.004195    .0215668
       SPILL |   .0061511   .0044579     1.38   0.172    -.0027294    .0150316
       _cons |   .0231166   .0026961     8.57   0.000     .0177456    .0284875
------------------------------------------------------------------------------

added macro:
                e(rsq) : "0.005"

added macro:
       e(mean_outcome) : "0.022"
Confidence interval for formula:
TREAT-SPILL

------------------------------------------------------------------------------
attrition_~t | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0025348   .0068609     0.37   0.713    -.0111327    .0162023
------------------------------------------------------------------------------

Linear regression, absorbing indicators             Number of obs     =  5,540
Absorbed variable: strata                           No. of categories =      8
                                                    F(2, 34)          =   0.50
                                                    Prob > F          = 0.6119
                                                    R-squared         = 0.0045
                                                    Adj R-squared     = 0.0029
                                                    Root MSE          = 0.1374

                                (Std. err. adjusted for 35 clusters in school)
------------------------------------------------------------------------------
             |               Robust
  attrition1 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       TREAT |   .0036219   .0086067     0.42   0.677    -.0138689    .0211128
       SPILL |    .005539   .0056981     0.97   0.338     -.006041     .017119
       _cons |   .0166858   .0035852     4.65   0.000     .0093998    .0239719
------------------------------------------------------------------------------

added macro:
                e(rsq) : "0.005"

added macro:
       e(mean_outcome) : "0.017"
Confidence interval for formula:
TREAT-SPILL

------------------------------------------------------------------------------
  attrition1 | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0019171   .0093044    -0.21   0.838     -.020826    .0169918
------------------------------------------------------------------------------

Linear regression, absorbing indicators             Number of obs     =  5,540
Absorbed variable: strata                           No. of categories =      8
                                                    F(2, 34)          =   0.63
                                                    Prob > F          = 0.5368
                                                    R-squared         = 0.0051
                                                    Adj R-squared     = 0.0035
                                                    Root MSE          = 0.3511

                                (Std. err. adjusted for 35 clusters in school)
------------------------------------------------------------------------------
             |               Robust
  attrition2 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       TREAT |  -.0057366   .0238047    -0.24   0.811    -.0541137    .0426404
       SPILL |  -.0181846   .0175714    -1.03   0.308    -.0538939    .0175248
       _cons |   .1524358   .0111291    13.70   0.000     .1298187    .1750529
------------------------------------------------------------------------------

added macro:
                e(rsq) : "0.005"

added macro:
       e(mean_outcome) : "0.151"
Confidence interval for formula:
TREAT-SPILL

------------------------------------------------------------------------------
  attrition2 | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0124479   .0197276     0.63   0.532    -.0276433    .0525392
------------------------------------------------------------------------------

Linear regression, absorbing indicators             Number of obs     =  5,540
Absorbed variable: strata                           No. of categories =      8
                                                    F(2, 34)          =   0.95
                                                    Prob > F          = 0.3966
                                                    R-squared         = 0.0083
                                                    Adj R-squared     = 0.0067
                                                    Root MSE          = 0.1451

                                (Std. err. adjusted for 35 clusters in school)
------------------------------------------------------------------------------
             |               Robust
attrition_~t | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       TREAT |   .0125271   .0112451     1.11   0.273    -.0103256    .0353799
       SPILL |   .0128263   .0093056     1.38   0.177     -.006085    .0317376
       _cons |   .0150515   .0066062     2.28   0.029     .0016261    .0284768
------------------------------------------------------------------------------

added macro:
                e(rsq) : "0.008"

added macro:
       e(mean_outcome) : "0.015"
Confidence interval for formula:
TREAT-SPILL

------------------------------------------------------------------------------
attrition_~t | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0002992   .0068647    -0.04   0.965    -.0142499    .0136515
------------------------------------------------------------------------------

.         local filename table_attrition_a 

.         
.         esttab ta110* ta112* using "$tabfig/`filename'.tex", f replace ///
>         mgroups("STEM sample" "TVET sample", pattern(1 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
>         keep(TREAT) star(* 0.10 ** 0.05 *** 0.01) cell(b(fmt(3) star) se(fmt(3) par)) label noobs collabels(none) noline posthead(\midrule) ///
>         mtitle("\shortstack{1st Follow-up \\ Survey}" "\shortstack{Test Score \\ Data }"  ///
>         "\shortstack{1st Follow-up \\ Survey}" "\shortstack{2nd Follow-up \\ Survey}" "\shortstack{Test Score \\ Data }") ///
>         varlabels(TREAT "Treatment")
(file ../output/tables_figures/table_attrition_a.tex not found)
(output written to ../output/tables_figures/table_attrition_a.tex)

.         
.         esttab ta110* ta112* using "$tabfig/`filename'.tex", f append ///
>         keep(SPILL) star(* 0.10 ** 0.05 *** 0.01) cell(b(fmt(3) star) se(fmt(3) par)) noobs collabels(none) noline nonumber nomtitle ///
>         scalar("N Observations" "rsq R-squared" "mean_outcome Control Mean")  varlabels(SPILL "Spillover")
(output written to ../output/tables_figures/table_attrition_a.tex)

.         
.         esttab dta110* dta112* using "$tabfig/`filename'.tex", f append ///
>         varlabels((1) "p-value (TREAT)-(SPILL)=0") noobs nogap nomtitle nonumber cells(p(fmt(3))) collabels(none) noline postfoot(\midrule)
(output written to ../output/tables_figures/table_attrition_a.tex)

.         
. 
. // Whether attrition individuals are different in terms of baseline values 
. // of primary and secondary outcome variables 
. 
. cap erase "$tabfig/table_attrition_b_grade10.tex"

. cap erase "$tabfig/table_attrition_b_grade12.tex"

. 
. foreach grade in 10 12 {        
  2.         foreach i in primary secondary {
  3.         foreach x of global grade`grade'_`i' {
  4.                 
.                 * obtain labels
.                 local Label`x': variable label `x'
  5.         
.                 * obtain # observations
.                 qui sum `x' if grade == `grade'
  6.                 local N: dis %3.0f r(N)
  7.                 local Ns = "`N'"
  8. 
.                 * obtain mean non-attriters 
.                 qui sum `x' if attrition1 == 0 & grade==`grade'
  9.                 local meanC: dis %3.2f r(mean)
 10.                 local meanCs = "`meanC'"
 11.                 
.                 * obtain difference between attriters and non-attriters
.                 qui areg `x' attrition1 if grade==`grade', a(strata) cl(school)
 12.                 foreach group in attrition1 {
 13.                         local diff`group': dis %4.2f _b[`group']
 14.                         local diff`group's: dis "`diff`group''"
 15.                         
.                         scalar t = _b[`group']/_se[`group']
 16.                         local p`group' = 2*ttail(e(df_r), abs(`=scalar(t)'))
 17.                         local pvalue`group': dis %4.2f `p`group''
 18.                         local pvalue`group's: dis "`pvalue`group''"
 19.                 }
 20. 
.                 
.                 * export results
.                 if inlist("`x'", "i_sci_top1_bl", "i_f9g_bl") {
 21.                         mata R = ("", "", "", "" \ "`N'", "`meanCs'", "`diffattrition1s'" , "`pvalueattrition1s'")
 22.                         mmat2tex R using "$tabfig/table_attrition_b_grade`grade'.tex", append rownames("\emph{Panel A: Primary Outcomes}" "`Label`x''")
 23.                 } 
 24.                 else if inlist("`x'", "i_e6_bl", "z_bluecollarbias_bl") {
 25.                         mata R = ("", "", "", "" \ "`N'", "`meanCs'", "`diffattrition1s'" , "`pvalueattrition1s'")
 26.                         mmat2tex R using "$tabfig/table_attrition_b_grade`grade'.tex", append rownames("\emph{Panel B: Intermediate Outcomes}" "`Label`x''")
 27.                 } 
 28.                 else {
 29.                         mata R = ("`N'", "`meanCs'", "`diffattrition1s'" , "`pvalueattrition1s'")
 30.                         mmat2tex R using "$tabfig/table_attrition_b_grade`grade'.tex", append rownames("`Label`x''")
 31.                 }
 32.                 }
 33.         }
 34. }
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_b_grade12.tex

. 
. // Whether baseline characteristics of attrition individuals in the treatment 
. // and spillover are different from those in the control group 
. 
. cap erase "$tabfig/table_attrition_c_grade10.tex"

. cap erase "$tabfig/table_attrition_c_grade12.tex"

. 
. foreach grade in 10 12 {        
  2.         foreach i in primary secondary {
  3.         foreach x of global grade`grade'_`i' {
  4.                 
.                 * obtain labels
.                 local Label`x': variable label `x'
  5.         
.                 * obtain # observations
.                 qui sum `x' if attrition1 == 1 & grade == `grade' 
  6.                 local N: dis %3.0f r(N)
  7.                 local Ns = "`N'"
  8.                 
.                 if `N' ~= 0 {
  9. 
.                 * obtain mean attriters of the control group
.                 qui sum `x' if attrition1 == 1 & CONTROL==1 & grade==`grade'
 10.                 local meanC: dis %3.2f r(mean)
 11.                 local meanCs = "`meanC'"
 12.                 
.                 * obtain difference between TREAT and SPILL among attriters
.                 qui areg `x' TREAT SPILL if attrition1 == 1 & grade==`grade', a(strata) cl(school)
 13.                 foreach group in TREAT SPILL {
 14.                         local diff`group': dis %4.2f _b[`group']
 15.                         local diff`group's: dis "`diff`group''"
 16.                         
.                         scalar t = _b[`group']/_se[`group']
 17.                         local p`group' = 2*ttail(e(df_r), abs(`=scalar(t)'))
 18.                         local pvalue`group': dis %4.2f `p`group''
 19.                         local pvalue`group's: dis "`pvalue`group''"
 20.                 }
 21.                 
.                 * export results
.                 if inlist("`x'", "i_sci_top1_bl", "i_f9g_bl") {
 22.                         mata R = ("", "", "", "" , "" , "" \ "`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'")
 23.                         mmat2tex R using "$tabfig/table_attrition_c_grade`grade'.tex", append rownames("\emph{Panel A: Primary Outcomes}" "`Label`x''")
 24.                 } 
 25.                 else if inlist("`x'", "i_e6_bl", "z_bluecollarbias_bl") {
 26.                         mata R = ("", "", "", "" , "" , "" \ "`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'")
 27.                         mmat2tex R using "$tabfig/table_attrition_c_grade`grade'.tex", append rownames("\emph{Panel B: Intermediate Outcomes}" "`Label`x''")
 28.                 } 
 29.                 else {
 30.                         mata R = ("`N'", "`meanCs'", "`diffTREATs'" , "`pvalueTREATs'", "`diffSPILLs'" , "`pvalueSPILLs'")
 31.                         mmat2tex R using "$tabfig/table_attrition_c_grade`grade'.tex", append rownames("`Label`x''")
 32.                 }
 33.                 }
 34.         }
 35.         }
 36. }
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade10.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex
Latex file written to ../output/tables_figures/table_attrition_c_grade12.tex

. 
. 
. 
. *****************************************************************************
. *****************************************************************************
. ************************** MAIN RESULTS *************************************
. *****************************************************************************
. *****************************************************************************
. 
. use "$clean/grade10_analysis.dta", clear

. gen grade = 10 

. append using "$clean/grade12_analysis.dta"
(label rateexper already defined)
(label male already defined)

. replace grade = 12 if missing(grade)
(5,540 real changes made)

. 
. gl grade10_covariates "age_bl male father_edu mother_edu z_wealth_bl z_perf_math_bl z_perf_scie_bl z_perf_oths_bl z_perf_all_bl potentialshare z_big5extro_bl z_big5
> agree_bl z_big5consci_bl z_big5neuro_bl z_big5open_bl"

. gl grade12_covariates "age_bl male father_edu mother_edu z_wealth_bl z_perf_eng_bl z_perf_lang_bl z_perf_all_bl potentialshare z_big5extro_bl z_big5agree_bl z_big5c
> onsci_bl z_big5neuro_bl z_big5open_bl"

. 
. * Create missing variables for covariates 
. foreach grade in 10 12 {
  2.         foreach x of global grade`grade'_covariates {
  3.                 cap gen miss_`x' = 0
  4.                 cap gen imputed_`x' = .
  5.                 cap replace miss_`x' = 1 if missing(`x') & grade==`grade'
  6.                 replace imputed_`x' = `x' if grade==`grade'
  7.                 su `x' if grade == `grade', de
  8.                 replace imputed_`x' = r(p50) if grade==`grade' & missing(`x')
  9.         } 
 10. }
(6,458 real changes made)

                             Age
-------------------------------------------------------------
      Percentiles      Smallest
 1%           15             14
 5%           15             14
10%           15             14       Obs               6,458
25%           16             14       Sum of wgt.       6,458

50%           17                      Mean           16.75875
                        Largest       Std. dev.      1.322547
75%           17             21
90%           18             21       Variance        1.74913
95%           19             21       Skewness        .850761
99%           21             21       Kurtosis       3.831047
(0 real changes made)
(6,458 real changes made)

                            Male
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               6,458
25%            0              0       Sum of wgt.       6,458

50%            0                      Mean           .4487457
                        Largest       Std. dev.      .4974046
75%            1              1
90%            1              1       Variance       .2474113
95%            1              1       Skewness       .2061028
99%            1              1       Kurtosis       1.042478
(0 real changes made)
(5,878 real changes made)

           Father with high school diploma (dummy)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               5,878
25%            0              0       Sum of wgt.       5,878

50%            0                      Mean           .2024498
                        Largest       Std. dev.      .4018599
75%            0              1
90%            1              1       Variance       .1614914
95%            1              1       Skewness       1.480991
99%            1              1       Kurtosis       3.193335
(580 real changes made)
(6,105 real changes made)

           Mother with high school diploma (dummy)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               6,105
25%            0              0       Sum of wgt.       6,105

50%            0                      Mean           .1239967
                        Largest       Std. dev.      .3296048
75%            0              1
90%            1              1       Variance       .1086393
95%            1              1       Skewness       2.281727
99%            1              1       Kurtosis       6.206277
(353 real changes made)
(5,492 real changes made)

                     Wealth index (PCA)
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.095874      -2.734257
 5%    -1.949332      -2.734257
10%     -1.34622      -2.734257       Obs               5,492
25%    -.6368323      -2.693683       Sum of wgt.       5,492

50%    -.0414453                      Mean          -.0149985
                        Largest       Std. dev.      1.016726
75%     1.056919        1.51036
90%     1.097493        1.51036       Variance       1.033731
95%     1.469786        1.51036       Skewness      -.3937105
99%     1.469786        1.51036       Kurtosis       2.215659
(966 real changes made)
(6,395 real changes made)

             Subjective performance index: math
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -1.417003      -1.417003
 5%    -1.417003      -1.417003
10%    -1.417003      -1.417003       Obs               6,395
25%     -.469057      -1.417003       Sum of wgt.       6,395

50%     -.469057                      Mean           .0147732
                        Largest       Std. dev.      1.006064
75%     .4788885        2.37478
90%     1.426834        2.37478       Variance       1.012164
95%     1.426834        2.37478       Skewness       .4233854
99%      2.37478        2.37478       Kurtosis       2.623412
(63 real changes made)
(6,416 real changes made)

       Subjective performance index: science subjects
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.087495      -2.087495
 5%    -1.703798      -2.087495
10%    -1.320101      -2.087495       Obs               6,416
25%    -.9364046      -2.087495       Sum of wgt.       6,416

50%    -.1690108                      Mean          -.0355303
                        Largest       Std. dev.      1.006916
75%     .5983828       2.516867
90%     1.365777       2.516867       Variance       1.013879
95%     1.749474       2.516867       Skewness       .3312366
99%     2.516867       2.516867       Kurtosis       2.749002
(42 real changes made)
(6,424 real changes made)

     Subjective performance index: non-science subjects
-------------------------------------------------------------
      Percentiles      Smallest
 1%     -2.36923      -3.090958
 5%    -1.647501      -3.090958
10%    -1.286637      -3.090958       Obs               6,424
25%    -.5649092      -3.090958       Sum of wgt.       6,424

50%     -.204045                      Mean          -.0104682
                        Largest       Std. dev.       1.00364
75%     .5176831       2.682868
90%     1.239411       2.682868       Variance       1.007292
95%     1.600276       2.682868       Skewness       .1846184
99%     2.322004       2.682868       Kurtosis       2.976745
(34 real changes made)
(6,002 real changes made)

            Subjective performance index: overall
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.821948      -2.821948
 5%    -1.636857      -2.821948
10%    -1.636857      -2.821948       Obs               6,002
25%    -.4517657      -2.821948       Sum of wgt.       6,002

50%    -.4517657                      Mean           .0051321
                        Largest       Std. dev.       .983123
75%     .7333255       1.918417
90%     .7333255       1.918417       Variance       .9665309
95%     1.918417       1.918417       Skewness      -.3393748
99%     1.918417       1.918417       Kurtosis       3.251295
(456 real changes made)
(6,458 real changes made)

                 Potential share of mentees
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%     .0318952              0       Obs               6,458
25%     .0379438              0       Sum of wgt.       6,458

50%     .3074721                      Mean           .2702921
                        Largest       Std. dev.      .1971789
75%     .4806488       .5311443
90%     .4995629       .5311443       Variance       .0388795
95%     .5066046       .5311443       Skewness      -.1156485
99%      .513875       .5311443       Kurtosis       1.360363
(0 real changes made)
(6,430 real changes made)

                  Big 5 extroversion index
-------------------------------------------------------------
      Percentiles      Smallest
 1%     -2.29137      -4.369946
 5%    -1.771726      -3.330658
10%    -1.252082      -3.330658       Obs               6,430
25%    -.7324383      -3.330658       Sum of wgt.       6,430

50%     .3068498                      Mean           .0143379
                        Largest       Std. dev.      .9944049
75%     .8264936       3.424714
90%     1.346138       3.424714       Variance       .9888411
95%     1.865782       3.424714       Skewness       -.043379
99%     2.385426       3.424714       Kurtosis       3.442601
(28 real changes made)
(6,424 real changes made)

                    Big 5 agreeness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.509388      -5.354527
 5%    -1.371332      -4.216471
10%    -1.371332      -4.216471       Obs               6,424
25%    -.8023043      -4.216471       Sum of wgt.       6,424

50%    -.2332767                      Mean           .0177989
                        Largest       Std. dev.      1.010139
75%      .904779        3.18089
90%     1.473807        3.18089       Variance       1.020381
95%     1.473807        3.18089       Skewness      -.0709377
99%     2.611862        3.18089       Kurtosis       3.937891
(34 real changes made)
(6,442 real changes made)

                Big 5 conscientiousness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%     -2.46138      -4.517704
 5%    -1.433219      -4.517704
10%    -.9191378      -4.517704       Obs               6,442
25%    -.4050566      -4.517704       Sum of wgt.       6,442

50%     .1090241                      Mean            .033133
                        Largest       Std. dev.        .99321
75%     .6231049       2.679428
90%     1.137186        3.19351       Variance       .9864662
95%     1.651267        3.19351       Skewness      -.2258833
99%     2.165348        3.19351       Kurtosis       3.540587
(16 real changes made)
(6,439 real changes made)

                   Big 5 neuroticism index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.510936      -4.462786
 5%    -1.535011      -4.462786
10%    -1.047049      -3.486861       Obs               6,439
25%    -.5590863      -3.486861       Sum of wgt.       6,439

50%     -.071124                      Mean          -.0298226
                        Largest       Std. dev.      1.002616
75%     .4168383       2.856651
90%     1.392763       2.856651       Variance       1.005239
95%     1.392763       2.856651       Skewness      -.1688995
99%     2.368688       2.856651       Kurtosis       3.411886
(19 real changes made)
(6,427 real changes made)

                    Big 5 openness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.286943       -3.76927
 5%    -1.792834       -3.76927
10%    -1.298725       -3.76927       Obs               6,427
25%    -.8046164       -3.76927       Sum of wgt.       6,427

50%     .1836016                      Mean           .0032791
                        Largest       Std. dev.      1.012839
75%     .6777105       2.160037
90%      1.17182       2.160037       Variance       1.025843
95%     1.665928       2.160037       Skewness      -.3217386
99%     2.160037       2.160037       Kurtosis       3.243406
(31 real changes made)
(5,540 real changes made)

                             Age
-------------------------------------------------------------
      Percentiles      Smallest
 1%           16             14
 5%           17             15
10%           17             15       Obs               5,540
25%           18             15       Sum of wgt.       5,540

50%           19                      Mean           18.87762
                        Largest       Std. dev.      1.432795
75%           20             26
90%           21             26       Variance       2.052902
95%           21             28       Skewness       .8019828
99%           23             29       Kurtosis       4.546761
(0 real changes made)
(5,540 real changes made)

                            Male
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               5,540
25%            0              0       Sum of wgt.       5,540

50%            0                      Mean           .4341155
                        Largest       Std. dev.       .495685
75%            1              1
90%            1              1       Variance       .2457036
95%            1              1       Skewness        .265856
99%            1              1       Kurtosis       1.070679
(0 real changes made)
(4,874 real changes made)

           Father with high school diploma (dummy)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               4,874
25%            0              0       Sum of wgt.       4,874

50%            0                      Mean           .2076323
                        Largest       Std. dev.      .4056537
75%            0              1
90%            1              1       Variance       .1645549
95%            1              1       Skewness       1.441612
99%            1              1       Kurtosis       3.078246
(666 real changes made)
(5,527 real changes made)

           Mother with high school diploma (dummy)
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs               5,527
25%            0              0       Sum of wgt.       5,527

50%            0                      Mean           .0468609
                        Largest       Std. dev.      .2113599
75%            0              1
90%            0              1       Variance        .044673
95%            0              1       Skewness       4.288232
99%            1              1       Kurtosis       19.38893
(13 real changes made)
(4,802 real changes made)

                     Wealth index (PCA)
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.568091      -3.439675
 5%    -1.894211      -3.439675
10%    -1.462005      -3.439675       Obs               4,802
25%    -.7793966      -3.439675       Sum of wgt.       4,802

50%     .3061585                      Mean          -.0253235
                        Largest       Std. dev.      1.004253
75%     .8943802       1.311239
90%     .8943802       1.311239       Variance       1.008523
95%     1.311239       1.311239       Skewness      -.7174976
99%     1.311239       1.311239       Kurtosis       2.799637
(738 real changes made)
(5,446 real changes made)

            Subjective performance index: english
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -1.816331      -3.226456
 5%    -1.816331      -3.226456
10%    -1.816331      -3.226456       Obs               5,446
25%    -.4062066      -3.226456       Sum of wgt.       5,446

50%    -.4062066                      Mean           .0029005
                        Largest       Std. dev.      .9803231
75%     1.003918       2.414043
90%     1.003918       2.414043       Variance       .9610334
95%     1.003918       2.414043       Skewness      -.0543615
99%     2.414043       2.414043       Kurtosis       3.068318
(94 real changes made)
(5,492 real changes made)

           Subjective performance index: dzongkha
-------------------------------------------------------------
      Percentiles      Smallest
 1%     -2.12014      -3.429566
 5%     -2.12014      -3.429566
10%    -.8107147      -3.429566       Obs               5,492
25%    -.8107147      -3.429566       Sum of wgt.       5,492

50%     .4987109                      Mean           .0359296
                        Largest       Std. dev.      .9909821
75%     .4987109       1.808136
90%     1.808136       1.808136       Variance       .9820455
95%     1.808136       1.808136       Skewness      -.1747941
99%     1.808136       1.808136       Kurtosis       3.002897
(48 real changes made)
(5,100 real changes made)

            Subjective performance index: overall
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.261904      -3.722968
 5%    -1.531372      -3.722968
10%    -.8008395      -3.722968       Obs               5,100
25%    -.8008395      -3.722968       Sum of wgt.       5,100

50%     .6602249                      Mean          -.0038432
                        Largest       Std. dev.      1.004142
75%     .6602249       2.121289
90%     .6602249       2.121289       Variance       1.008302
95%     2.121289       2.121289       Skewness      -.3342197
99%     2.121289       2.121289       Kurtosis       3.405629
(440 real changes made)
(5,540 real changes made)

                 Potential share of mentees
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .0796927       .0796927
 5%     .0965066       .0796927
10%     .0998599       .0796927       Obs               5,540
25%     .1113295       .0796927       Sum of wgt.       5,540

50%     .1128528                      Mean           .2066606
                        Largest       Std. dev.      .1515781
75%      .274847       .5219815
90%      .488477       .5219815       Variance       .0229759
95%      .492782       .5219815       Skewness       1.124481
99%     .5219815       .5219815       Kurtosis        2.57812
(0 real changes made)
(5,483 real changes made)

                  Big 5 extroversion index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.671445       -4.10979
 5%    -1.712549       -4.10979
10%    -1.233101      -3.150893       Obs               5,483
25%    -.7536526      -3.150893       Sum of wgt.       5,483

50%     .2052439                      Mean          -.0126633
                        Largest       Std. dev.      .9772166
75%      .684692       3.081933
90%      1.16414       3.081933       Variance       .9549523
95%     1.643588       3.081933       Skewness      -.0776078
99%     2.362761       3.081933       Kurtosis       3.665367
(57 real changes made)
(5,468 real changes made)

                    Big 5 agreeness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.119644      -5.435316
 5%    -1.567032      -5.435316
10%     -1.01442      -4.606398       Obs               5,468
25%    -.4618077      -4.330092       Sum of wgt.       5,468

50%     .0908042                      Mean           .0334511
                        Largest       Std. dev.       1.00937
75%     .6434164       2.853864
90%     1.196028       2.853864       Variance       1.018828
95%     1.748641       2.853864       Skewness      -.0341337
99%     2.301252       2.853864       Kurtosis       3.630544
(72 real changes made)
(5,478 real changes made)

                Big 5 conscientiousness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.588056      -4.549201
 5%    -1.607484      -4.549201
10%    -1.117198      -4.549201       Obs               5,478
25%    -.6269111      -3.813772       Sum of wgt.       5,478

50%     -.136625                      Mean           .0405422
                        Largest       Std. dev.      .9923616
75%     .8439477       2.805093
90%     1.334234       2.805093       Variance       .9847816
95%      1.82452       2.805093       Skewness      -.2308571
99%     2.314806       2.805093       Kurtosis       3.553404
(62 real changes made)
(5,480 real changes made)

                   Big 5 neuroticism index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.804071      -4.182573
 5%     -1.42557      -4.182573
10%     -1.42557      -4.182573       Obs               5,480
25%    -.5065683      -4.182573       Sum of wgt.       5,480

50%    -.0470678                      Mean          -.0302977
                        Largest       Std. dev.      .9798681
75%     .4124326       2.709936
90%     1.331434       2.709936       Variance       .9601414
95%     1.790935       2.709936       Skewness      -.1460438
99%     2.250435       2.709936       Kurtosis       3.494454
(60 real changes made)
(5,464 real changes made)

                    Big 5 openness index
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -2.627928      -4.098247
 5%    -1.647716      -4.098247
10%     -1.15761      -4.098247       Obs               5,464
25%    -.6675038      -4.098247       Sum of wgt.       5,464

50%     .3127086                      Mean          -.0217278
                        Largest       Std. dev.      1.001677
75%      .802815       1.783027
90%     1.292921       1.783027       Variance       1.003357
95%     1.783027       1.783027       Skewness      -.4895889
99%     1.783027       1.783027       Kurtosis       3.560217
(76 real changes made)

. 
. * Outcome variables 
. gl grade10_primary_e "i_sci_top1 i_sci_enrolled"

. gl grade10_secondary_e "z_score_math z_score_phy z_score_che z_score_bio" 

. gl grade10_attitude_e "i_e6 z_attitude_stem z_genderbias z_subj_sci z_obj_sci z_e9c z_approval_sci z_e16c z_ability z_like_math z_like_scie z_like_all passing_bcse"

. 
. gl grade12_primary_e "i_f9g i_f14g s_app_tvet s_adm_tvet" 

. gl grade12_secondary_e  "a_app_tvet a_adm_tvet z_prep_lang z_prep_eng z_prep_all passing_bhsec z_score_eng z_score_dzo"

. gl grade12_attitude_e "z_attitude_stem z_genderbias_tvet z_bluecollarbias z_subj_tvet z_obj_tvet z_satisfied_tvet z_approval_tvet z_f16g z_ability_tvet i_g4b i_g5b"

. 
. lab var i_sci_enrolled "Enrolled in science stream in grade 11 (dummy)"

. lab var passing_bcse "Passed BCSE certificate (dummy)"

. lab var passing_bhsec "Passed BHSEC certificate (dummy)"

. 
. * Create a "fake" baseline outcomes for all outcomes, value 0
. foreach grade in 10 12 {
  2.         foreach i in primary secondary attitude {
  3.                 foreach x of global grade`grade'_`i'_e {
  4.                         cap gen `x'_bl = 0
  5.                 } 
  6.         }
  7. }

. 
. * Covariates with missing dummies 
. gl grade10_controls "imputed_age_bl imputed_male imputed_father_edu imputed_mother_edu imputed_z_wealth_bl imputed_z_perf_math_bl imputed_z_perf_scie_bl imputed_z_p
> erf_oths_bl imputed_z_perf_all_bl imputed_potentialshare imputed_z_big5extro_bl imputed_z_big5agree_bl imputed_z_big5consci_bl imputed_z_big5neuro_bl imputed_z_big5
> open_bl"

. gl grade10_Mdummies "miss_age_bl miss_male miss_father_edu miss_mother_edu miss_z_wealth_bl miss_z_perf_math_bl miss_z_perf_scie_bl miss_z_perf_oths_bl miss_z_perf_
> all_bl miss_potentialshare miss_z_big5extro_bl miss_z_big5agree_bl miss_z_big5consci_bl miss_z_big5neuro_bl miss_z_big5open_bl"

. 
. gl grade12_controls "imputed_age_bl imputed_male imputed_father_edu imputed_mother_edu imputed_z_wealth_bl imputed_z_perf_eng_bl imputed_z_perf_lang_bl imputed_z_pe
> rf_all_bl imputed_potentialshare imputed_z_big5extro_bl imputed_z_big5agree_bl imputed_z_big5consci_bl imputed_z_big5neuro_bl imputed_z_big5open_bl"

. gl grade12_Mdummies "miss_age_bl miss_male miss_father_edu miss_mother_edu miss_z_wealth_bl miss_z_perf_eng_bl miss_z_perf_lang_bl miss_z_perf_all_bl miss_potential
> share miss_z_big5extro_bl miss_z_big5agree_bl miss_z_big5consci_bl miss_z_big5neuro_bl miss_z_big5open_bl"

. 
. cap erase "$tabfig/main_grade10_primary.tex"

. cap erase "$tabfig/main_grade10_secondary.tex"

. cap erase "$tabfig/main_grade10_attitude.tex"

. cap erase "$tabfig/main_grade12_primary.tex"

. cap erase "$tabfig/main_grade12_secondary.tex"

. cap erase "$tabfig/main_grade12_attitude.tex"

. 
. foreach grade in 10 12 {
  2.         qui rwolf ${grade`grade'_primary_e} ${grade`grade'_secondary_e} ${grade`grade'_attitude_e} if grade == `grade', indepvar(TREAT SPILL) method(areg) abs(st
> rata) bl(_bl) controls(${grade`grade'_controls} ${grade`grade'_Mdummies}) reps(250) seed(10101) cl(school)
  3. 
.         foreach i in primary secondary attitude {
  4.                 foreach x of global grade`grade'_`i'_e {        
  5.                         * Romano-Wolf
.                         local rw_`x'_TREAT: dis %4.3f e(rw_`x'_TREAT)
  6.                         local rw_`x'_TREATs: dis "[`rw_`x'_TREAT']"
  7.                         local rw_`x'_SPILL: dis %4.3f e(rw_`x'_SPILL)
  8.                         local rw_`x'_SPILLs: dis "[`rw_`x'_SPILL']"
  9.                 }
 10.         }
 11.         
.         qui rwolf ${grade`grade'_primary_e} ${grade`grade'_secondary_e} ${grade`grade'_attitude_e} if CONTROL!=1 & grade == `grade', indepvar(TREAT) method(areg) bl
> (_bl) controls(${grade`grade'_controls} ${grade`grade'_Mdummies}) abs(school) reps(250) seed(10101)
 12. 
.         foreach i in primary secondary attitude {
 13.                 foreach x of global grade`grade'_`i'_e {        
 14.                         * Romano-Wolf
.                         local rw_`x'_TREATC: dis %4.3f e(rw_`x')
 15.                         local rw_`x'_TREATCs: dis "[`rw_`x'_TREATC']"
 16.                 }
 17.         }
 18. 
. 
.         foreach i in primary secondary attitude {
 19.         foreach x of global grade`grade'_`i'_e {                
 20.         * obtain labels
.         local Label`x': variable label `x'
 21.         
.         * obtain # observations
.         qui sum `x' if grade == `grade'
 22.         local N: dis %3.0f r(N)
 23.         local Ns = "`N'"
 24.         
.         * obtain mean Control 
.         qui sum `x' if CONTROL == 1 & grade==`grade'
 25.         local meanC: dis %3.2f r(mean)
 26.         local meanCs = "`meanC'"
 27.         
.         local sdC: dis %3.2f r(sd)
 28.         local sdCs: dis "(`sdC')"
 29.         
.         * obtain difference coef & se between TREAT & CONTROL
.         
.         qui areg `x' TREAT SPILL `x'_bl ${grade`grade'_controls} ${grade`grade'_Mdummies} if grade==`grade', a(strata) cl(school)
 30.         foreach group in TREAT SPILL {
 31.         scalar t = _b[`group']/_se[`group']
 32.         add_symbol
 33.         
.         local diff`group': dis %4.3f _b[`group']
 34.         local diff`group's: dis "`diff`group''`=scalar(symbol)'"
 35.                 
.         local diffse`group': dis %4.3f _se[`group']
 36.         local diffse`group's: dis "(`diffse`group'')"   
 37.         
.                 if `grade' == 12 {
 38.                         qui boottest `group', cl(school) qui nogr seed(10101)
 39.                         local pbt`group': dis %4.3f r(p)
 40.                         local pbt`group's: dis "$\left\lbrace `pbt`group'' \right\rbrace$"
 41.                 }
 42.         }
 43.         
.         * obtain difference between TREAT & SPILL 
.         qui areg `x' TREAT `x'_bl ${grade`grade'_controls} ${grade`grade'_Mdummies} if CONTROL!=1 & grade==`grade', a(school)
 44.         scalar t = _b[TREAT]/_se[TREAT]
 45.         add_symbol
 46.         local diffTS: dis %4.3f _b[TREAT]
 47.         local diffTSs: dis "`diffTS'`=scalar(symbol)'"
 48.         
.         local diffseTS: dis %4.3f _se[TREAT]
 49.         local diffseTSs: dis "(`diffseTS')"
 50.         
.         * export results 
.         if `grade' == 12 {
 51.                 mata R = ("`N'", "`meanC'", "`diffTREATs'" , "`diffSPILLs'", "`diffTSs'"  \ "", "`sdCs'", "`diffseTREATs'", "`diffseSPILLs'",  "`diffseTSs'" \ ""
> , "", "`pbtTREATs'", "`pbtSPILLs'", "" \ "", "", "`rw_`x'_TREATs'", "`rw_`x'_SPILLs'", "`rw_`x'_TREATCs'" )
 52.                 if "`i'" == "primary" {
 53.                         mmat2tex R using "$tabfig/main_grade`grade'_primary.tex", append rownames("`Label`x''" "" "" "")
 54.                 }
 55.                 if "`i'" == "secondary" {
 56.                         mmat2tex R using "$tabfig/main_grade`grade'_secondary.tex", append rownames("`Label`x''" "" "" "")
 57.                 }
 58.                 if "`i'" == "attitude" {
 59.                         mmat2tex R using "$tabfig/main_grade`grade'_attitude.tex", append rownames("`Label`x''" "" "" "")
 60.                 }
 61.         }
 62.         
.         
.         if `grade' == 10 {
 63.                 mata R = ("`N'", "`meanC'", "`diffTREATs'" , "`diffSPILLs'", "`diffTSs'"  \ "", "`sdCs'", "`diffseTREATs'", "`diffseSPILLs'",  "`diffseTSs'" \ ""
> , "", "`rw_`x'_TREATs'", "`rw_`x'_SPILLs'", "`rw_`x'_TREATCs'" )
 64.                 if "`i'" == "primary" {
 65.                         mmat2tex R using "$tabfig/main_grade`grade'_primary.tex", append rownames("`Label`x''" "" "")
 66.                 }
 67.                 if "`i'" == "secondary" {
 68.                         mmat2tex R using "$tabfig/main_grade`grade'_secondary.tex", append rownames("`Label`x''" "" "" )
 69.                 }
 70.                 if "`i'" == "attitude" {
 71.                         mmat2tex R using "$tabfig/main_grade`grade'_attitude.tex", append rownames("`Label`x''" "" "")
 72.                 }
 73.         }
 74.         }
 75.         }
 76. }
--Break--
r(1);

end of do-file
--Break--
r(1);

end of do-file

--Break--
r(1);

. exit, clear
